{include file="header"}
<div class="layui-fluid">
    <div class="layui-card">
      <div class="layui-card-body" style="padding: 15px;">
        <!--表单提交-->
        {if get('id',0) == '0'}
        <form class="layui-form" url="{:url('admin/api/add')}" t_url="javascript:parent.location.reload();">
        {else /}
        <form class="layui-form" url="{:url('admin/api/edit')}" t_url="javascript:parent.location.reload();">
        <input type="hidden" name="id" value="{$c.id}">
        {/if}
        <input type="hidden" name="model" value="cateAdmin">
          <div class="layui-form-item">
            <div class="layui-inline">
              <label class="layui-form-label">选择分类</label>
              <div class="layui-input-inline">
                 <select name="tid" lay-verify="required" >
                  <option value="0">顶级分类</option>
                  {foreach name=":fun_S('cateAdmin',array('tid'=>0),'px desc','1000',1)" item="v" key="k"}
                 <option value="{$v.id}" {if $c.tid == $v.id}selected="选择"{/if}{if $v['id'] == input('id')}disabled=""{/if}>{$v.name}</option>
                  {volist name=":fun_s('cateAdmin',array('tid'=>$v['id']),'px desc',100,1)" id="vo"}
                  <option value="{$vo.id}" disabled="禁用">——{$vo.name}</option>
                  {/volist}  
                  {/foreach} 
                </select>
        </div>
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">名称</label>
            <div class="layui-input-block">
              <input type="text" name="name" value="{$c.name}" lay-verify="required" autocomplete="off" placeholder="请输入标题" class="layui-input">
            </div>
          </div>
      
          <div class="layui-form-item">
            <label class="layui-form-label">URL链接</label>
            <div class="layui-input-block">
              <input type="text" name="lianjie" value="{$c.lianjie}" lay-verify="required" autocomplete="off" placeholder="例如 /index.php/admin/index/index.html" class="layui-input">
            </div>
          </div>
      <div class="layui-form-item">
            <label for="L_title" class="layui-form-label">图标</label>
              <div class="layui-input-inline">
                <input type="text" name="ico" value="{$c.ico|default="&#xe6a7;"}" placeholder="不填写默认即可"  autocomplete="off" class="layui-input">
        </div>
        <a href="http://www.37717.com.cn/demo/eb6f91f23a21e676fadbbc5ad9be7f5e/html/unicode.html" target="_blank" class="layui-form-mid layui-word-aux">例如 & #xe6a7; 点击查看</a>
          </div>
      
      
          <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
              <input type="radio" name="open" value="1" title="显示" {if $c.open == 1}checked=""{/if}>
        <input type="radio" name="open" value="0" title="隐藏" {if $c.open == 0}checked=""{/if}>
      </div>
          </div>
      <div class="layui-form-item">
            <label for="L_title" class="layui-form-label">排序</label>
              <div class="layui-input-inline" style="width: 100px;">
                <input type="number" name="px" value="{$c.px}" autocomplete="off" class="layui-input">
              </div>
          </div>
          <div class="layui-form-item layui-layout-admin">
            <div class="layui-input-block">
              <div class="layui-footer" style="left: 0;">
                <button class="layui-btn" lay-submit="" lay-filter="cms">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
              </div>
            </div>
          </div>
        </form>
      </div>
    </div>
  </div>
  {include file="footer"}